package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.result.PhoneBean;
import com.common.retrofit.service.HaiNingService;

import rx.Observable;
import rx.Subscriber;

public class ModifyPswMethods extends BaseMethods {

    private static ModifyPswMethods m_ins = null;

    public static ModifyPswMethods getInstance() {
        if (m_ins == null) {
            synchronized (ModifyPswMethods.class) {
                if (m_ins == null) {
                    m_ins = new ModifyPswMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "User/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void updatePwd(Subscriber<Object> subscriber,
                      int uid,
                      String hashid  ,String oldpwd,String newpwd,String repeatpwd) {
        Observable observable = initService().updatePwd(System.currentTimeMillis()+"",
                "d889fb1feccacc88634963c636d402e6",uid,hashid,oldpwd,newpwd,repeatpwd
        );
        toSubscribe(observable, subscriber);
    }
}
